-- GENERATED SPELL FOR [Captain Xurrem] --


function spell0_15390(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15390', 569, 1)
end

function spell1_15390(pUnit, Event) --@Shockwave,Self--
pUnit:FullCastSpellOnTarget(25425,pUnit)
pUnit:RegisterEvent('Sorts_15390', 2278, 1)
end

function spell2_15390(pUnit, Event) --@Sunder Armor,n/a--
pUnit:FullCastSpellOnTarget(24317,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15390', 20258, 1)
end

function Sorts_15390(pUnit, Event)
local choix_sorts_15390 = math.random(0, 2)
if choix_sorts_15390 == 0 then
pUnit:RegisterEvent('spell0_15390', 1, 1)
end
if choix_sorts_15390 == 1 then
pUnit:RegisterEvent('spell1_15390', 1, 1)
end
if choix_sorts_15390 == 2 then
pUnit:RegisterEvent('spell2_15390', 1, 1)
end
end

function mob15390_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15390', math.random(1500, 3000), 1)
end

function mob15390_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15390_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15390_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15390, 1, 'mob15390_Action')
RegisterUnitEvent(15390, 2, 'mob15390_Leave')
RegisterUnitEvent(15390, 3, 'mob15390_Kill')
RegisterUnitEvent(15390, 4, 'mob15390_Die')
